package com.ruoyi.transaction.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 用户优惠券记录对象 user_coupon
 * 
 * @author x
 * @date 2025-08-09
 */
public class UserCoupon extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 用户ID（关联用户表） */
    @Excel(name = "用户ID", readConverterExp = "关=联用户表")
    private Long membersId;

    /** 优惠券ID（关联coupon_info） */
    @Excel(name = "优惠券ID", readConverterExp = "关=联coupon_info")
    private Long couponId;

    /** 状态（0未使用，1已使用，2已过期） */
    @Excel(name = "状态", readConverterExp = "0=未使用，1已使用，2已过期")
    private Long status;

    /** 领取时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "领取时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date receivedTime;

    /** 使用时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date usedTime;

    /** 使用该券的订单ID */
    @Excel(name = "使用该券的订单ID")
    private Long orderId;

    /** 来源：1平台发放 2活动领取 3兑换所得 */
    @Excel(name = "来源：1平台发放 2活动领取 3兑换所得")
    private Long sourceType;

    /** 删除标志（0未删除，1已删除） */
    private String delFlag;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setMembersId(Long membersId) 
    {
        this.membersId = membersId;
    }

    public Long getMembersId() 
    {
        return membersId;
    }

    public void setCouponId(Long couponId) 
    {
        this.couponId = couponId;
    }

    public Long getCouponId() 
    {
        return couponId;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setReceivedTime(Date receivedTime) 
    {
        this.receivedTime = receivedTime;
    }

    public Date getReceivedTime() 
    {
        return receivedTime;
    }

    public void setUsedTime(Date usedTime) 
    {
        this.usedTime = usedTime;
    }

    public Date getUsedTime() 
    {
        return usedTime;
    }

    public void setOrderId(Long orderId) 
    {
        this.orderId = orderId;
    }

    public Long getOrderId() 
    {
        return orderId;
    }

    public void setSourceType(Long sourceType) 
    {
        this.sourceType = sourceType;
    }

    public Long getSourceType() 
    {
        return sourceType;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("membersId", getMembersId())
            .append("couponId", getCouponId())
            .append("status", getStatus())
            .append("receivedTime", getReceivedTime())
            .append("usedTime", getUsedTime())
            .append("orderId", getOrderId())
            .append("sourceType", getSourceType())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
